<?php

class GroupRouteCollection extends sgeRouteCollection
{

	protected function getRouteForAddUser()
	{
		return new $this->routeClass(
			sprintf('%s/:%s/usuarios/%s.:sf_format', $this->options['prefix_path'], $this->options['column'], 'agregar_usuario'),
			array_merge(array('module' => $this->options['module'], 'action' => 'addUser', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => array('get', 'post'))),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	protected function getRouteForUsers()
	{
		return new $this->routeClass(
			sprintf('%s/:%s/usuarios.:sf_format', $this->options['prefix_path'], $this->options['column']),
			array_merge(array('module' => $this->options['module'], 'action' => 'users', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => 'get')),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	protected function getRouteForPermissions()
	{
		return new $this->routeClass(
			sprintf('%s/:%s/permisos.:sf_format', $this->options['prefix_path'], $this->options['column']),
			array_merge(array('module' => $this->options['module'], 'action' => 'permissions', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => 'get')),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	protected function getRouteForAddPermission()
	{
		return new $this->routeClass(
			sprintf('%s/:%s/permisos/%s.:sf_format', $this->options['prefix_path'], $this->options['column'], 'agregar_permiso'),
			array_merge(array('module' => $this->options['module'], 'action' => 'addPermission', 'sf_format' => 'html'), $this->options['default_params']),
			array_merge($this->options['requirements'], array('sf_method' => array('get', 'post'))),
			array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object'])
		);
	}

	protected function getDefaultActions()
	{
		return array_merge(parent::getDefaultActions(), array('addUser', 'users', 'permissions', 'addPermission'));
	}

}


